{% extends "tcms_base.html" %}
{% load static %}
{% load attachments_tags %}
{% block subtitle %} {{ test_plan.name }}{% endblock %}

{% block custom_stylesheet %}
<link rel="stylesheet" type="text/css" href="{% static 'style/print.css' %}" media="print" />
<style>
#tab_testcases{ padding-left:5px;}
#tab_testruns {padding-left:5px;}
</style>
{% endblock %}

{% block custom_javascript %}
<script type="text/javascript" src="{% static 'js/testplan_actions.js' %}"></script>
<script type="text/javascript" src="{% static 'js/testcase_actions.js' %}"></script>
{% endblock %}

{% block contents %}

<div id="content">
	<input id="id_plan_id" type="hidden" name="plan_id" value="{{ test_plan.plan_id }}">
	<div id="" class="planDetail">
		<h2 id="display_title" style="line-height:1.2em;">{{ test_plan.name }}</h2>
		</div><!-- plan detail end-->
			<div class="Detailform border-1">
                            {% attachment_form test_plan %}
				<span class="right-action">
					Note: Each attachment size limit is {{ limit|filesizeformat }}.
				</span>

			<table class="list" cellspacing="0" cellspan="0">
				<thead>
					<tr class="titlelink">
						<th align="left">File name</th>
						<th align="left" width="20%">Submitter</th>
						<th align="left" width="20%">Create date</th>
						<th align="left" width="10%">Action</th>
					</tr>
				</thead>
				<tbody>
                                    {% get_attachments_for test_plan as attachments_list %}
                                    {% for attachment in attachments_list %}
                                    <tr class="{% cycle 'odd' 'even' %}">
                                       <td><a href="{{ attachment.attachment_file.url }}">{{ attachment.filename }}</a></td>
                                        <td>{{ attachment.creator }}</td>
                                        <td>{{ attachment.created }}</td>
                                        <td>{% attachment_delete_link attachment %}</td>
                                    </tr>
                                    {% endfor %}
				</tbody>
			</table>
		</div>
	</div>
</div>

{% endblock %}
